package uuid

import (
	"backend/pkg/logging"
	uuid2 "github.com/satori/go.uuid"
)

/**
	生成UUID
 */
func GenerateUuid() uuid2.UUID {
	uuid, _ := uuid2.NewV4()

	return uuid
}


/**
	解析为UUID
 */
func ParseUuid(uuid string) (uuid2.UUID, interface{}) {
	uid, err := uuid2.FromString(uuid)
	if err != nil {
		logging.Fatal(err)
		return uid, err
	}

	return uid, nil
}
